#ifndef VEC2_INCLUDED
#define VEC2_INCLUDED

#pragma once

#include "vec.h"

template <typename T>
union vec<T, 2>
{
	T data[2];
	struct { T x, y; };

	vec()
		: x(T()), y(T())
	{
	}

	vec(const vec& rhs)
		: x(rhs.x), y(rhs.y)
	{
	}

	vec(T _x, T _y)
		: x(_x), y(_y)
	{
	}
};

template <typename Type>
Type CrossProduct(const vec<Type, 2>& a, const vec<Type, 2>& b)
{
	return a.x * b.y - a.y * b.x;
}

typedef vec<float, 2> vec2f;
typedef vec<double, 2> vec2d;


#endif
